﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configers
{
    public class HFConfigers : IEntityTypeConfiguration<HF>
    {
        public void Configure(EntityTypeBuilder<HF> builder)
        {
            builder.ToTable(nameof(HF));
            builder.Property(x => x.HumanId).IsRequired().HasMaxLength(30);
            builder.Property(x => x.FirstKindId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.FirstKindName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.SecondKindId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.SecondKindName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.ThirdKindId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.ThirdKindName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanAddress).IsRequired(false).HasMaxLength(200);

            builder.Property(x => x.HumanPostcode).IsRequired(false).HasMaxLength(10);
            builder.Property(x => x.HumanProDesignation).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanMajorKindId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.HumanMajorKindName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanMajorId).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.HunmaMajorName).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanTelephone).IsRequired(false).HasMaxLength(20);
            builder.Property(x => x.HumanMobilephone).IsRequired(false).HasMaxLength(11);
            builder.Property(x => x.HumanBank).IsRequired(false).HasMaxLength(50);
            builder.Property(x => x.HumanAccount).IsRequired(false).HasMaxLength(30);

            builder.Property(x => x.HumanQQ).IsRequired(false).HasMaxLength(15);
            builder.Property(x => x.HumanEmail).IsRequired(false).HasMaxLength(50);
            builder.Property(x => x.HumanHobby).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanSpeciality).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanSex).IsRequired(false).HasMaxLength(2);
            builder.Property(x => x.HumanReligion).IsRequired(false).HasMaxLength(50);
            builder.Property(x => x.HumanParty).IsRequired(false).HasMaxLength(50);
            builder.Property(x => x.HumanNationality).IsRequired(false).HasMaxLength(50);
            builder.Property(x => x.HumanRace).IsRequired(false).HasMaxLength(50);
            builder.Property(x => x.HumanBirthday).IsRequired(false);

            builder.Property(x => x.HumanBirthplace).IsRequired(false).HasMaxLength(50);
            builder.Property(x => x.HumanAge).IsRequired(false);
            builder.Property(x => x.HumanEducatedDegree).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanEducatedYears).IsRequired(false);
            builder.Property(x => x.HumanEducatedMajor).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.HumanSocietySecurityId).IsRequired(false).HasMaxLength(30);
            builder.Property(x => x.HumanIdCard).IsRequired().HasMaxLength(20);
            builder.Property(x => x.Remark).IsRequired(false);
            builder.Property(x => x.SalaryStandardId).IsRequired(false).HasMaxLength(30);
            builder.Property(x => x.SalaryStandardName).IsRequired(false).HasMaxLength(60);

            builder.Property(x => x.SalarySum).IsRequired(false);
            builder.Property(x => x.DemandSalaraySum).IsRequired(false);
            builder.Property(x => x.PaidSalarySum).IsRequired(false);
            builder.Property(x => x.MajorChangeAmount).IsRequired(false);
            builder.Property(x => x.BonusAmount).IsRequired(false);
            builder.Property(x => x.TrainingAmount).IsRequired(false);
            builder.Property(x => x.FileChangAmount).IsRequired();
            builder.Property(x => x.HumanHistroyRecords).IsRequired(false);
            builder.Property(x => x.HumanFamilyMembership).IsRequired(false);
            builder.Property(x => x.HumanPicture).IsRequired(false).HasMaxLength(225);

            builder.Property(x => x.AttachmentName).IsRequired(false).HasMaxLength(225);
            builder.Property(x => x.CheckStatus).IsRequired(false);
            builder.Property(x => x.Register).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.Checker).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.Changer).IsRequired(false).HasMaxLength(60);
            builder.Property(x => x.RegistTime).IsRequired(false);
            builder.Property(x => x.CheckTime).IsRequired(false);
            builder.Property(x => x.ChangeTime).IsRequired(false);
            builder.Property(x => x.LastlyChangeTime).IsRequired(false);
            builder.Property(x => x.DeleteTime).IsRequired(false);

            builder.Property(x => x.RecoveryTime).IsRequired(false);
            builder.Property(x => x.HumanFileStatus).IsRequired(false);
        }
    }
}
